<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>设置公告及新闻</title>

    <meta name="description" content="Static &amp; Dynamic Tables" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

    <!-- bootstrap & fontawesome -->
    <link rel="stylesheet" href="../css/bootstrap.min.css" />
    <link rel="stylesheet" href="../css/font-awesome.min.css" />

    <!-- page specific plugin styles -->

    <!-- text fonts -->
    <link rel="stylesheet" href="../css/ace-fonts.css" />

    <!-- ace styles -->
    <link rel="stylesheet" href="../css/ace.min.css" id="main-ace-style" />

    <!--[if lte IE 9]>
    <link rel="stylesheet" href="../css/ace-part2.min.css" />
    <![endif]-->
    <link rel="stylesheet" href="../css/ace-skins.min.css" />
    <link rel="stylesheet" href="../css/ace-rtl.min.css" />

    <!--[if lte IE 9]>
    <link rel="stylesheet" href="../css/ace-ie.min.css" />
    <![endif]-->

    <!-- inline styles related to this page -->

    <!-- ace settings handler -->
    <script src="../js/ace-extra.min.js"></script>

    <!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

    <!--[if lte IE 8]>
    <script src="../js/html5shiv.min.js"></script>
    <script src="../js/respond.min.js"></script>
    <![endif]-->
</head>

<body class="no-skin" ng-controller="kNews">
<!-- #section:basics/navbar.layout -->
<div id="navbar" class="navbar navbar-default">
    <script type="text/javascript">
        try{ace.settings.check('navbar' , 'fixed')}catch(e){}
    </script>

    <div class="navbar-container" id="navbar-container">
        <!-- #section:basics/sidebar.mobile.toggle -->
        <button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler">
            <span class="sr-only">Toggle sidebar</span>

            <span class="icon-bar"></span>

            <span class="icon-bar"></span>

            <span class="icon-bar"></span>
        </button>

        <!-- /section:basics/sidebar.mobile.toggle -->
        <div class="navbar-header pull-left">
            <!-- #section:basics/navbar.layout.brand -->
            <a href="#" class="navbar-brand">
                <small>
                    <i class="fa fa-leaf"></i>
                    小黄莺艺术学校 | Admin
                </small>
            </a>

            <!-- /section:basics/navbar.layout.brand -->

            <!-- #section:basics/navbar.toggle -->

            <!-- /section:basics/navbar.toggle -->
        </div>

        <!-- #section:basics/navbar.dropdown -->
        <div class="navbar-buttons navbar-header pull-right" role="navigation">
            <ul class="nav ace-nav">

                <li class="green">
                    <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                        <i class="ace-icon fa fa-envelope icon-animated-vertical"></i>
                    </a>
                </li>

                <!-- #section:basics/navbar.user_menu -->
                <li class="light-blue">
                    <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                        <img class="nav-user-photo" src="../assets/avatars/user.jpg" alt="Jason's Photo" />
    							<span class="user-info">
									<small>Welcome,</small>
									Jason
								</span>

                        <i class="ace-icon fa fa-caret-down"></i>
                    </a>

                    <ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
                        <li>
                            <a href="#">
                                <i class="ace-icon fa fa-cog"></i>
                                Settings
                            </a>
                        </li>

                        <li class="divider"></li>

                        <li>
                            <a href="#">
                                <i class="ace-icon fa fa-power-off"></i>
                                Logout
                            </a>
                        </li>
                    </ul>
                </li>

                <!-- /section:basics/navbar.user_menu -->
            </ul>
        </div>

        <!-- /section:basics/navbar.dropdown -->
    </div><!-- /.navbar-container -->
</div>

<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try{ace.settings.check('main-container' , 'fixed')}catch(e){}
    </script>

    <!-- #section:basics/sidebar -->
    <div id="sidebar" class="sidebar responsive">
        <script type="text/javascript">
            try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
        </script>

        <div class="sidebar-shortcuts" id="sidebar-shortcuts">
            <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
                <button class="btn btn-success">
                    <i class="ace-icon fa fa-signal"></i>
                </button>

                <button class="btn btn-info">
                    <i class="ace-icon fa fa-pencil"></i>
                </button>

                <!-- #section:basics/sidebar.layout.shortcuts -->
                <button class="btn btn-warning">
                    <i class="ace-icon fa fa-users"></i>
                </button>

                <button class="btn btn-danger">
                    <i class="ace-icon fa fa-cogs"></i>
                </button>

                <!-- /section:basics/sidebar.layout.shortcuts -->
            </div>

            <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
                <span class="btn btn-success"></span>

                <span class="btn btn-info"></span>

                <span class="btn btn-warning"></span>

                <span class="btn btn-danger"></span>
            </div>
        </div><!-- /.sidebar-shortcuts -->

        <ul class="nav nav-list">

            <li class="active open">
                <a href="#" class="dropdown-toggle">
                    <i class="menu-icon fa fa-list"></i>
                    <span class="menu-text"> 系统管理员 </span>

                    <b class="arrow fa fa-angle-down"></b>
                </a>

                <b class="arrow"></b>

                <ul class="submenu">
                    <li>
                        <a href="ClassPreset.html">
                            <i class="menu-icon fa fa-caret-right"></i>
                            班级预设
                        </a>
                    </li>
                    <li  class="active">
                        <a href="CourseApproval.html">
                            <i class="menu-icon fa fa-caret-right"></i>
                            设置公告及新闻
                        </a>
                    </li>

                </ul>
            </li>
        </ul><!-- /.nav-list -->

        <!-- #section:basics/sidebar.layout.minimize -->
        <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
            <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
        </div>

        <!-- /section:basics/sidebar.layout.minimize -->
        <script type="text/javascript">
            try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
        </script>
    </div>

    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <!-- #section:basics/content.breadcrumbs -->
        <div class="breadcrumbs" id="breadcrumbs">
            <script type="text/javascript">
                try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
            </script>

            <ul class="breadcrumb">
                <li>
                    <i class="ace-icon fa fa-home home-icon"></i>
                    <a href="#">系统管理员</a>
                </li>
                <li class="active">设置公告及新闻 </li>
            </ul><!-- /.breadcrumb -->

            <!-- #section:basics/content.searchbox -->
            <div class="nav-search" id="nav-search">
                <form class="form-search">
							<span class="input-icon">
								<input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
								<i class="ace-icon fa fa-search nav-search-icon"></i>
							</span>
                </form>
            </div><!-- /.nav-search -->

            <!-- /section:basics/content.searchbox -->
        </div>

        <div class="ace-settings-container" id="ace-settings-container">
            <a href="#modal-add" role="button" class="green" data-toggle="modal">
                <button class="btn btn-info">添加课程</button>
            </a>
        </div>

        <!-- /section:basics/content.breadcrumbs -->
        <div class="page-content">
            <!-- /section:settings.box -->
            <div class="page-content-area">
                <div class="page-header">
                    <h1>
                        <i class="ace-icon fa fa-angle-double-right"></i>
                        <i class="ace-icon fa fa-angle-double-right"></i>
                        <i class="ace-icon fa fa-angle-double-right"></i>
                        设置公告及新闻
                    </h1>
                </div><!-- /.page-header -->

                <div class="row">
                    <div class="col-xs-6">
                        <div>
                           <div class="form-group row">
								<label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 标题 </label>
								<div class="col-sm-9">
									<input type="text" ng-model="knews.ntitle" id="form-field-1" placeholder="标题" class="col-xs-10 col-sm-5" />
								</div>
							</div>
							{{ name }}

							<div class="form-group row">
								<label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 链接 </label>
								<div class="col-sm-9">
									<input type="text" ng-model="knews.ncontent" id="form-field-1" placeholder="链接" class="col-xs-10 col-sm-5" />
								</div>
							</div>

							<div class="form-group row">
								<label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 类型 </label>
								<div class="col-sm-9">
									<select ng-model="knews.nstate" class="col-sm-5" data-placeholder="Choose a State...">
										<option value="1">公告</option>
										<option value="2">新闻</option>
										<option value="3">友情链接</option>
									</select>
								</div>
							</div>

							<div class="form-group row">
								<label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 详情 </label>
								<div class="col-sm-9">
									<textarea ng-model="knews.nnote" class="form-control" style="height:200px;" id="form-field-8" placeholder="详情"></textarea>
								</div>
							</div>
							
							<div class="form-group row">
								<div class="col-sm-2 col-sm-offset-8">
									<button class=" btn btn-info" type="button" ng-click="insertKNews()">
										<i class="ace-icon fa fa-check bigger-110"></i>
										提交
									</button>
								</div>
							</div>

                        </div>
                    </div>
                </div>
                
                
                
                <div id="modal-add" class="modal fade" tabindex="-1">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header no-padding">
                                <div class="table-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                        <span class="white">&times;</span>
                                    </button>
                                    课程审核
                                </div>
                            </div>

                            <div class="modal-body no-padding">
                                <div>
                                    <div>
                                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 课程名称 </label>
                                        <div class="col-sm-9">
                                            <input type="text" id="form-field-1" class="col-xs-10 col-sm-5" ng-model="kClass.name" />
                                        </div>
                                    </div>
                                    <div>
                                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 课程介绍 </label>
                                        <div class="col-sm-9">
                                            <input type="text" id="form-field-1" class="col-xs-10 col-sm-5" ng-model="kClass.info" />
                                        </div>
                                    </div>
                                    <div>
                                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 学生要求 </label>
                                        <div class="col-sm-9">
                                            <input type="text" id="form-field-1" class="col-xs-10 col-sm-5" ng-model="kClass.req" />
                                        </div>
                                    </div>
                                    <div>
                                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 合作方 </label>
                                        <div class="col-sm-9">
                                            <input type="text" id="form-field-1" class="col-xs-10 col-sm-5" ng-model="kClass.partner" />
                                        </div>
                                    </div>
                                    <div>
                                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 费用 </label>
                                        <div class="col-sm-9">
                                            <input type="text" id="form-field-2" class="col-xs-10 col-sm-5" ng-model="kClass.cost" />
                                        </div>
                                    </div>
                                    <div>
                                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 备注 </label>
                                        <div class="col-sm-9">
                                            <input type="text" id="form-field-2" class="col-xs-10 col-sm-5" ng-model="kClass.note" />
                                        </div>
                                    </div>
                                </div>


                                <div class="modal-footer no-margin-top">
                                    <button class="btn btn-sm btn-success" ng-click="addKClass()" data-dismiss="modal">
                                        <i class="ace-icon fa fa-floppy-o bigger-160"></i>
                                        	保存
                                    </button>
                                    <button class="btn btn-sm btn-success" data-dismiss="modal">
                                        	取消
                                    </button>
                                </div>
                            </div><!-- /.modal-content -->
                        </div><!-- /.modal-dialog -->
                </div><!-- PAGE CONTENT ENDS -->

            </div><!-- /.page-content-area -->
            
            

                <div id="modal-change" class="modal fade" tabindex="-1">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header no-padding">
                                <div class="table-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                        <span class="white">&times;</span>
                                    </button>
                                    课程审核
                                </div>
                            </div>

                            <div class="modal-body no-padding">
                                <div>
                                    <div>
                                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 课程名称 </label>
                                        <div class="col-sm-9">
                                            <input type="text" id="form-field-1" class="col-xs-10 col-sm-5" ng-model="kClass.name" />
                                        </div>
                                    </div>
                                    <div>
                                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 课程介绍 </label>
                                        <div class="col-sm-9">
                                            <input type="text" id="form-field-1" class="col-xs-10 col-sm-5" ng-model="kClass.info" />
                                        </div>
                                    </div>
                                    <div>
                                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 学生要求 </label>
                                        <div class="col-sm-9">
                                            <input type="text" id="form-field-1" class="col-xs-10 col-sm-5" ng-model="kClass.req" />
                                        </div>
                                    </div>
                                    <div>
                                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 合作方 </label>
                                        <div class="col-sm-9">
                                            <input type="text" id="form-field-1" class="col-xs-10 col-sm-5" ng-model="kClass.partner" />
                                        </div>
                                    </div>
                                    <div>
                                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 费用 </label>
                                        <div class="col-sm-9">
                                            <input type="text" id="form-field-2" class="col-xs-10 col-sm-5" ng-model="kClass.cost" />
                                        </div>
                                    </div>
                                    <div>
                                        <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 备注 </label>
                                        <div class="col-sm-9">
                                            <input type="text" id="form-field-2" class="col-xs-10 col-sm-5" ng-model="kClass.note" />
                                        </div>
                                    </div>
                                </div>


                                <div class="modal-footer no-margin-top">
                                    <button class="btn btn-sm btn-success" ng-click="changeKClass()" data-dismiss="modal">
                                        <i class="ace-icon fa fa-floppy-o bigger-160"></i>
                                        	保存
                                    </button>
                                    <button class="btn btn-sm btn-success" data-dismiss="modal">
                                        	取消
                                    </button>
                                </div>
                            </div><!-- /.modal-content -->
                        </div><!-- /.modal-dialog -->
                </div><!-- PAGE CONTENT ENDS -->

            </div><!-- /.page-content-area -->
        </div><!-- /.page-content -->
    </div><!-- /.main-content -->

    <div class="footer">
        <div class="footer-inner">
            <!-- #section:basics/footer -->
            <div class="footer-content">
						<span class="bigger-120">
							<span class="blue bolder">KID</span>
							Education &copy; 2016
						</span>
            </div>

            <!-- /section:basics/footer -->
        </div>
    </div>

    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
    </a>
</div><!-- /.main-container -->

<!-- basic scripts -->

<!--[if !IE]> -->
<script type="text/javascript">
    window.jQuery || document.write("<script src='../js/jquery.min.js'>"+"<"+"/script>");
</script>

<!-- <![endif]-->

<!--[if IE]>
<script type="text/javascript">
    window.jQuery || document.write("<script src='../js/jquery1x.min.js'>"+"<"+"/script>");
</script>
<![endif]-->
<script type="text/javascript">
    if('ontouchstart' in document.documentElement) document.write("<script src='../js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
</script>
<script src="../js/bootstrap.min.js"></script>

<!-- page specific plugin scripts -->
<script src="../js/jquery.dataTables.min.js"></script>
<script src="../js/jquery.dataTables.bootstrap.js"></script>

<!-- ace scripts -->
<script src="../js/ace-elements.min.js"></script>
<script src="../js/ace.min.js"></script>

<!-- the following scripts are used in demo only for onpage help and you don't need them -->
<link rel="stylesheet" href="../css/ace.onpage-help.css" />
<link rel="stylesheet" href="../css/sunburst.css" />

<script type="text/javascript"> ace.vars['base'] = '..'; </script>
<script src="../js/elements.onpage-help.js"></script>
<script src="../js/ace.onpage-help.js"></script>
<script src="../js/rainbow.js"></script>
<script src="../js/generic.js"></script>
<script src="../js/html.js"></script>
<script src="../js/css.js"></script>
<script src="../js/javascript.js"></script>
<script src="../js/angular.min.js"></script>
<script>
	var m = angular.module('myApp', []);
	m.controller('kNews', ['$scope', '$http', function($scope, $http){
		$scope.insertKNews = function(){
			knewsJSON = JSON.stringify($scope.knews);
			$.ajax({
               	type: "post",
                dataType: "json",
                data: 
                {
                	"knewsJSON" :  knewsJSON
                },
                url: '../KNewsAction!insertKNews',
                error: function(request) {
                    console.log();
                },
                success: function(data) {
                	alert("成功！");
	            }
           	});
			$scope.knews.ntitle = "";
        	$scope.knews.ncontent = '';
        	$scope.knews.nnote = '';
        	$scope.knews.nstate = '';
		};
	}]);
</script>

</body>
</html>
